package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BizSysOffice;
import com.nmf.dao.gen.bean.BizSysOfficeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizSysOfficeMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @SelectProvider(type=BizSysOfficeSqlProvider.class, method="countByExample")
    long countByExample(BizSysOfficeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @DeleteProvider(type=BizSysOfficeSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizSysOfficeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @Delete({
        "delete from sys_office",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @Insert({
        "insert into sys_office (id, parent_id, ",
        "parent_ids, name, ",
        "sort, area_id, code, ",
        "type, grade, address, ",
        "zip_code, master, ",
        "phone, fax, email, ",
        "USEABLE, PRIMARY_PERSON, ",
        "DEPUTY_PERSON, create_by, ",
        "create_date, update_by, ",
        "update_date, remarks, ",
        "del_flag)",
        "values (#{id,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, ",
        "#{parentIds,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{sort,jdbcType=DECIMAL}, #{areaId,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, ",
        "#{type,jdbcType=CHAR}, #{grade,jdbcType=CHAR}, #{address,jdbcType=VARCHAR}, ",
        "#{zipCode,jdbcType=VARCHAR}, #{master,jdbcType=VARCHAR}, ",
        "#{phone,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, ",
        "#{useable,jdbcType=VARCHAR}, #{primaryPerson,jdbcType=VARCHAR}, ",
        "#{deputyPerson,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, ",
        "#{updateDate,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, ",
        "#{delFlag,jdbcType=CHAR})"
    })
    int insert(BizSysOffice record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @InsertProvider(type=BizSysOfficeSqlProvider.class, method="insertSelective")
    int insertSelective(BizSysOffice record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @SelectProvider(type=BizSysOfficeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="parent_id", property="parentId", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_ids", property="parentIds", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="sort", property="sort", jdbcType=JdbcType.DECIMAL),
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.VARCHAR),
        @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.CHAR),
        @Result(column="grade", property="grade", jdbcType=JdbcType.CHAR),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="zip_code", property="zipCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="master", property="master", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="fax", property="fax", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="USEABLE", property="useable", jdbcType=JdbcType.VARCHAR),
        @Result(column="PRIMARY_PERSON", property="primaryPerson", jdbcType=JdbcType.VARCHAR),
        @Result(column="DEPUTY_PERSON", property="deputyPerson", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<BizSysOffice> selectByExample(BizSysOfficeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @Select({
        "select",
        "id, parent_id, parent_ids, name, sort, area_id, code, type, grade, address, ",
        "zip_code, master, phone, fax, email, USEABLE, PRIMARY_PERSON, DEPUTY_PERSON, ",
        "create_by, create_date, update_by, update_date, remarks, del_flag",
        "from sys_office",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="parent_id", property="parentId", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_ids", property="parentIds", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="sort", property="sort", jdbcType=JdbcType.DECIMAL),
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.VARCHAR),
        @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.CHAR),
        @Result(column="grade", property="grade", jdbcType=JdbcType.CHAR),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="zip_code", property="zipCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="master", property="master", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="fax", property="fax", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="USEABLE", property="useable", jdbcType=JdbcType.VARCHAR),
        @Result(column="PRIMARY_PERSON", property="primaryPerson", jdbcType=JdbcType.VARCHAR),
        @Result(column="DEPUTY_PERSON", property="deputyPerson", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    BizSysOffice selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @UpdateProvider(type=BizSysOfficeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizSysOffice record, @Param("example") BizSysOfficeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @UpdateProvider(type=BizSysOfficeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizSysOffice record, @Param("example") BizSysOfficeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @UpdateProvider(type=BizSysOfficeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizSysOffice record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_office
     */
    @Update({
        "update sys_office",
        "set parent_id = #{parentId,jdbcType=VARCHAR},",
          "parent_ids = #{parentIds,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "sort = #{sort,jdbcType=DECIMAL},",
          "area_id = #{areaId,jdbcType=VARCHAR},",
          "code = #{code,jdbcType=VARCHAR},",
          "type = #{type,jdbcType=CHAR},",
          "grade = #{grade,jdbcType=CHAR},",
          "address = #{address,jdbcType=VARCHAR},",
          "zip_code = #{zipCode,jdbcType=VARCHAR},",
          "master = #{master,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "fax = #{fax,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR},",
          "USEABLE = #{useable,jdbcType=VARCHAR},",
          "PRIMARY_PERSON = #{primaryPerson,jdbcType=VARCHAR},",
          "DEPUTY_PERSON = #{deputyPerson,jdbcType=VARCHAR},",
          "create_by = #{createBy,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=VARCHAR},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizSysOffice record);
}